﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Text;
using Core;

namespace ConsoleClient
{
    class Program
    {
        static void Main(string[] args)
        {
            //SmtpClient s = new SmtpClient(Configuration.Exchange);
            //s.UseDefaultCredentials = true;
            ////s.Credentials = new NetworkCredential("Babenko", "Madhava108");
            //s.DeliveryMethod = SmtpDeliveryMethod.Network;
            //MailMessage m = new MailMessage("Nickolay.Babenko@exigenservices.com", "Nickolay.Babenko@exigenservices.com", "subject here", "body here");
            //m.IsBodyHtml = true;
            //s.Send(m);

            foreach (string arg in args)
            {
                if(!arg.Contains('='))
                    continue;
                var name = arg.Split('=')[0];
                var value = arg.Split('=')[1];
                if(name == "ReportDate")
                    Configuration.ReportDateValue = value;
                if(name == "ReportFinalDate")
                    Configuration.ReportFinalDateValue = value;
            }

            Console.WriteLine("Connecting to server...");
            var core = new Core.Core();
            core.Run();
            Console.WriteLine("Report generated.");
            Console.ReadLine();
        }
    }
}
